import pandas as pd
import numpy as np
import plotly.express as px
dffile = r'TEMP\HPC_SAMFormat.csv'
df = pd.read_csv(dffile)
df.set_index('datetime', inplace=True)
df.keys()
Index(['Year', 'Month', 'Day', 'Hour', 'Wspd', 'Tdry', 'DNI', 'DHI', 'GHI',
'rh', 'pressure', 'Albedo', 'EastFacing_POA', 'WestFacing_POA',
'East_Performance', 'West_Performance', 'solpos_zenith',
'solpos_azimuth', 'SouthFacing_POA', 'NorthFacing_POA',
'North_Performance', 'South_Performance'],
dtype='object')
fig = px.line(df, x=df.index, y=["DNI", 'DHI', 'GHI'])
fig.show()
fig = px.line(df, x=df.index, y=["North_Performance", "East_Performance", "South_Performance", "West_Performance"])
fig.show()
fig = px.histogram(df, x=df.index, y="North_Performance", histfunc="avg", title="Histogram on Date Axes")
fig.update_traces(xbins_size="M1")
datetime
2021-01-01 00:00:00-03:00 1087.963441
2021-01-01 01:00:00-03:00 1123.160486
2021-01-01 02:00:00-03:00 1111.483654
2021-01-01 03:00:00-03:00 1043.794416
2021-01-01 04:00:00-03:00 939.630716
...
2021-12-31 19:00:00-03:00 794.245927
2021-12-31 20:00:00-03:00 708.369757
2021-12-31 21:00:00-03:00 710.374610
2021-12-31 22:00:00-03:00 775.085668
2021-12-31 23:00:00-03:00 758.659913
Length: 8760, dtype: float64
df['NSEW_Performance'] = df[["North_Performance", "East_Performance", "South_Performance", "West_Performance"]].sum(axis=1)
fig = px.line(df, x=df.index, y='NSEW_Performance')
fig.show()
df['NSEW_PR'] = df['NSEW_Performance']/(1200)
fig = px.histogram(df, x=df.index, y="NSEW_PR", histfunc="avg", title="Histogram on Date Axes")
fig.update_traces(xbins_size="M1")